package com.lagou.edu.controller;

import com.lagou.edu.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/email")
public class EmailController {

    @Autowired
    private MailService mailService;

    @GetMapping("/send/{to}/{subject}/{text}")
    public boolean send(@PathVariable("to") String to,
                        @PathVariable("subject") String subject,
                        @PathVariable("text") String text) {
        return mailService.send(to, subject, text);
    }

}